<template>
    <div class="header">
        <template  v-if="this.$store.state.isLogin">
            <span>用户：</span>
            <el-button v-on:click="Loginout" type="primary">退出</el-button>
        </template>
</div>
</template>
<script>
    export default {
        class: 'header',
        methods: {
            Loginout: function() {

                this.$store.commit('changeLogin')
                this.$router.replace('/login')
            }
        }

    }
</script>
<style>
    .header {
        background-color: #f0f0f0;
        height: 60px;
    }
    
    h1 {
        text-align: center;
    }
</style>